<template>
  <view class="agreement">
    <scroll-view scroll-y class="content" @scrolltolower="handleScrollToBottom">
      <view style="width:100%;">
       <image src="https://xcx.essence-stock.com/images/yinsi.png" style="width:100%;" mode="widthFix" />
      </view>
    </scroll-view>

    <view class="agreement-footer">
      <button class="primary-button" :disabled="disabled" @click="closePrivacyPopup">全部已阅</button>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      disabled: true, // 是否禁用按钮
    }
  },
  methods: {
    handleScrollToBottom() {
      this.disabled = false
    },
    closePrivacyPopup() {
      this.$emit('close')
    },
  },
}
</script>

<style lang="scss" scoped>
.agreement {
  width: 92vw;
  height: 80vh;
  background-color: #fff;
  position: relative;
  padding: 20rpx;
  box-sizing: border-box;
  color: #c9a063;
  font-size: 20rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;

  .content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 100rpx;
  }

  .t1 {
    font-size: 30rpx;
  }

  .t2 {
    font-size: 24rpx;
    font-weight: bold;
    margin-top: 20rpx;
    margin-bottom: 30rpx;
  }

  .t3 {
    font-size: 20rpx;
    margin-bottom: 20rpx;
  }

  .agreement-footer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: calc(92vw - 40rpx);
    padding: 20rpx;

    button {
      width: 100%;
    }
  }
}
</style>